<template>
        <div class="app\_models\_product_edit">
        <div class="box" :class="'box-'+theme">
            <div class="box-header with-border">
                <h3 class="box-title">{{$t('Quickly fill in')}}</h3>
            </div>
            <div class="box-body">
                <edit :options="options" ref="edit">
                    <template slot="content" slot-scope="props">
                        <div class="move-items col-lg-4 col-md-6 col-sm-12 col-xs-12">
                            <edit-item key-name="description" :options="{name: '备注',type:'textarea', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_num" :options="{name: '数量',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_coding" :options="{name: '内部编码id',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_name" :options="{name: '产品名',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_img" :options="{name: '产品图片',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_asin" :options="{name: '产品Asin',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_sku" :options="{name: '产品SKU',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_label" :options="{name: '标签码地址',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_upc" :options="{name: 'UPS',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                        </div>
                        <div class="move-items col-lg-4 col-md-6 col-sm-12 col-xs-12">
                            <edit-item key-name="st_status" :options="{name: '产品状态 0-未审核 101-审核通过 301-审核未通过',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_stocks" :options="{name: '库存',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_weight" :options="{name: '产品重量 g为单位',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_size" :options="{name: '产品尺寸 cm为单位',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_head_cash" :options="{name: '头程费用',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_cash" :options="{name: '采购成本',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_is_small" :options="{name: '是否轻小件 1-是 2-否',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_product_status" :options="{name: '产品状态 300-在售 301-新品 302-停售',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_fnsku" :options="{name: '产品fnsku',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                        </div>
                        <div class="move-items col-lg-4 col-md-6 col-sm-12 col-xs-12">
                            <edit-item key-name="st_english" :options="{name: '英文关键词',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_country" :options="{name: '国家 站点',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_m_price" :options="{name: '新品定价',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_fba_cost" :options="{name: 'fba费用',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_profit" :options="{name: '利润',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_profit_ratio" :options="{name: '利润率',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_is_repertory" :options="{name: '是否有库存',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_shop_id" :options="{name: '店铺id',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                            <edit-item key-name="st_is_compose" :options="{name: '是否是组合 默认0 不是 1是组合',type:'text', rules:'',title:''}" :datas="props">
                            </edit-item>
                        </div>
                    </template>
                </edit>
            </div>
        </div>
    </div>
</template>

<script>
    import {mapState, mapActions, mapMutations, mapGetters} from 'vuex';

    export default {
        components: {
            edit: ()=>import(/* webpackChunkName: "common_components/edit.vue" */ 'common_components/edit.vue'),
            editItem: ()=>import(/* webpackChunkName: "common_components/editItem.vue" */ 'common_components/editItem.vue'),
            elDatePicker:()=>import(/* webpackChunkName: "element-ui/lib/date-picker" */ 'element-ui/lib/date-picker'), //日期组件
        },
        props: {
            url:{
                type: [String],
                default: function () {
                    return '';
                }
            },
            noBack:{
                type: [Boolean],
                default: function () {
                    return false;
                }
            },
            callback:{
                type: [Function],
                default: function () {
                    return function () {};
                }
            },
        },
        data() {
            return {
                options: {
                    lang_table:'products', //字段翻译
                    id: 'edit', //多个组件同时使用时唯一标识
                    params: null, //默认筛选条件
                    url:this.url || '', //数据表请求数据地址
                    no_back:this.noBack,
                    callback: (response, row) => { //修改成功
                        this.callback();
                    }
                }
            };
        },
        methods: {},
        computed: {
            ...mapState([
                'use_url',
                'theme'
            ])
        },
        watch:{
            url(val){
                this.options.url = val;
            }
        }
    };
</script>
